/*
Copyright (C) 2022-2024 Inspur Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/
package db

import "fmt"

const mysqlName = "mysql"

var (
	_ IEngine = &MysqlEngine{}
)

type MysqlEngine struct {
}

func (p MysqlEngine) EngineInfo(dbCfg *DBConfig) string {
	// root:112233@tcp(127.0.0.1:3305)/test?charset=utf8
	engineInfo := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8",
		dbCfg.User, dbCfg.Password, dbCfg.Host, dbCfg.Port, dbCfg.DBName)
	return engineInfo

}

func (p MysqlEngine) EngineName() string {
	return mysqlName
}
